<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>" />
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>证书  新增</title>
</head>
<body>
<script type="text/javascript">
 		$(function(){
 			$("#cf-Certificate-add").linkbutton({onClick:function(){
 				 $("#cf-Certificate-f").form({
 						onSubmit:function(param){	
 							param['certiId'] = $("#cf-Certificate-cid").textbox('getValue');
 							param['zszlId'] = $("#cf-Certificate-zszl1").textbox('getValue');
 							//param['zszlType'] = $("#cf-Certificate-zszl").textbox('getValue');
 							param['certiName'] =$("#cf-Certificate-name").textbox('getValue');
 							param['certiOwnertype'] =$("#cf-Certificate-type").textbox('getText');
 							param['certiBorrowstate'] =$("#cf-Certificate-Borrowtate").textbox('getValue');
 							param['certiUsestate'] =$("#cf-Certificate-usescid").textbox('getValue');
 							param['certiEffectivedate'] =$("#cf-Certificate-effdate").textbox('getValue'); 
 							return $(this).form('validate');
 						},
 						success:function(){
 							 
 						}
 					}).submit();
 				}});
 				$("#cf-Certificate-undo").linkbutton({onClick:function(){
 					 $('#cf-Certificate-panel').panel({href:'login_certificate',border:false});
 					
 				}});
 				$("#cf-click-dj").click(function(){
 					$('#cf-Certificate-f1').form({
 											onSubmit:function(param){
 							            		 //验证表单

 							             		 //return $(this).form('validate');
 							            	},success:function(v){
 					 						v= eval("("+v+")");	
 					 						console.log(v.file);
 					 						$('#img').form("clear");
 					 	              		$('#img').attr('src',v.file);
 					 	            	}
 					           	    }).submit();
 				});
 				 $("#cf-click-dj1").click(function(){
 							$('#cf-Certificate-f2').form({
 					 	           		 success:function(v){
 					 						v= eval("("+v+")");	
 					 						console.log(v.file);
 					 						$('#img1').form("clear");
 					 	              		$('#img1').attr('src',v.file);
 					 	            	}
 					           	    }).submit();
 				});
 				 $("#abc").hover(function(){
 					// alert(01);
 					 $("#guanbi").show();
 				 },function(){
 					 $("#guanbi").hide();
 				 });
 				 $("#abc1").hover(function(){
 						// alert(01);
 						 $("#guanbi1").show();
 					 },function(){
 						 $("#guanbi1").hide();
 					 });
 				 $("#cha").click(function(){
 					 $("#img").attr("src",""); 
 					 
 				 });
 				$("#cha1").click(function(){
 					 $("#img1").attr("src",""); 
 				 });
 				$("#cf-click-add").linkbutton({onClick:function(){
 					$("#cf-Certificate-win1").dialog("open");
 				}});
 					$("#cf-Certificate-search").linkbutton({onClick:function(){
 						var f=$("#cf-Certificate-searchbox1").searchbox("getText");
 						$('#cf-Certificate-tb1').datagrid('load','certificate_query?zszlName='+f);
 					}});
 				$("#cf-Certificate-tb1").datagrid({onDblClickRow:function(){
 					$("#cf-Certificate-win1").dialog("close");
 					var vv=$('#cf-Certificate-tb1').datagrid('getSelected');
 					 
 					$("#cf-Certificate-zszl1").textbox('setValue',vv.zszlId);
 					$("#cf-Certificate-zszl").textbox('setValue',vv.zszlName);
 					 
 					/* parent.$('.dialog-button a:eq(0)').hide();
 					parent.$('.dialog-button a:eq(1)').show(); */
 				}});
 		});
</script>
		<form id="cf-Certificate-f" action="Certificate_add" method="get">
				&nbsp;&nbsp;&nbsp;&nbsp;概要&nbsp;&nbsp;&nbsp;&nbsp;
				<a id="cf-Certificate-undo" class="easyui-linkbutton" data-options="iconCls:'icon-undo',plain:false,text:'返回'"></a>
			<br><img style="float:right;margin-right:568px;" src="/hr/images/CFlanxian20180903155415.jpg">
			<div style="float:left">
				<div class="line"style="margin-top:20px">
					        <input id="cf-Certificate-cid" class="easyui-textbox" 
						data-options="label:'证书编号',width:240">
				</div>
				<div class="line"style="margin-top:5px;margin-left:0px">
					       <input  style="" id="cf-Certificate-zszl1" class="easyui-textbox"
						data-options="label:'种类 id',width:200,editable:false,required:true">
			<a id="cf-click-add" class="easyui-linkbutton" data-options="iconCls:'icon-man',plain:true,
			width:26,height:26"></a>
						 <!-- <input id="cf-Certificate-zszl" class="easyui-textbox"
						data-options="width:80,editable:false,required:true"> -->
				</div>
				<div class="line"style="margin-top:5px">
					        <input id="cf-Certificate-name" class="easyui-textbox"
						data-options="label:'证书名称',width:240">
				</div>
				<div class="line"style="margin-top:5px;margin-left:35px">
				  <select id="cf-Certificate-type" class="easyui-combobox"  style="width:200px;"
					data-options="label:'持有者类型',width:240,panelHeight:'auto',editable:false">   
					    <option value="0">个人</option>   
					    <option value="1">公司</option>   
				</select>
				</div>
			</div>
			<div style="float:right;margin-top:20px;margin-right:208px;">	
				<div class="line"style="margin-top:5px;margin-left:0px">
					<select id="cf-Certificate-Borrowtate" class="easyui-combobox"  style="width:200px;"
					data-options="label:'使用状态',width:200,panelHeight:'auto',editable:false">   
					    <option value="0">正常</option>   
					    <option value="1">过期</option>   
					</select>  
				</div>
				<div class="line"style="margin-top:5px;margin-left:0px">
					<select id="cf-Certificate-usescid"  class="easyui-combobox"  style="width:200px;"
					 data-options="label:'借用状态',width:200,panelHeight:'auto',editable:false">   
					    <option value="0">在库</option>   
					    <option value="1">在借</option>   
					</select>  
				</div>
				<div class="line"style="margin-top:5px;margin-left:-30px">
					        <input id="cf-Certificate-effdate" class="easyui-datetimebox" 
						data-options="label:'有效日期',width:200,editable:false,required:true">
				</div>
				<div class="line"style="margin-top:15px;margin-left:0px">
					        <b style="margin-left:-80px">制单人</b><b style="margin-left:80px">${staff}</b>
					<br><img style="float:right;margin-right:498px;" src="/hr/images/zhidan.png">
				</div>
			</div>
			<img style="float:right;margin-right:548px;margin-top:18px" src="/hr/images/CFlanxian20180903155415.jpg">
			</form>
			<form id="cf-Certificate-f1" action="uploading" method="post" enctype="multipart/form-data">	
				<div  class="easyui-panel" data-option="width:340" style="width:800px;height:260px;
				margin-top:10px;margin-left:10px;border:0px">
						<div id="abc" style="border:1px solid #7d95bb;width:350px;height:255px;float:left;">
							<span id="zmzp" style="font-size:12px;color:#7d95bb;">正面照片</span>
							<span id="guanbi" style="float:right;color:#F6585A;cursor:pointer;
							text-align:center;display: none;">
							<span id="cha" style="font-size:15px;color:red;">X</span>
								<input style="width:200px;height:20px" class="easyui-filebox" name="f"  data-options="
								buttonText:'选择图片'">
							<img id="cf-click-dj" alt="点击上传图片" src="<c:url value="/images/cf-sc.png"/>"> 
							</span>
							<div id="cc" style="border:0px solid #7d95bb;width:350px;height:235px;">
								<img id="img" src=""  width="350px" height="200px">
							</div>
						</div>
				</form>
				<form id="cf-Certificate-f2" action="uploading" method="post" enctype="multipart/form-data">		
						<div id="abc1" style="border:1px solid #7d95bb;width:380px;height:255px;float:right;">
							<span id="fmzp" style="font-size:12px;color:#7d95bb;">反面照片</span>
							<span id="guanbi1" style="hright:30px;float:right;color:#F6585A;
							cursor:pointer;text-align:center;display: none;">
								<span id="cha1" style="font-size:15px;color:red;">X</span>
								<input style="width:200px;height:20px;margin-right:40px;" class="easyui-filebox" name="f" data-options="
								buttonText:'选择图片'">
								 <img class="xx" id="cf-click-dj1" alt="点击上传图片" src="<c:url value="/images/cf-sc.png"></c:url>">
							</span>
							<div id="cc1" style="border:0px solid #7d95bb;width:370px;height:235px;">
								<img id="img1" src="" width="350px" height="220px">
							</div>
						</div>
				</div>
			</form>
		<a id="cf-Certificate-add" style="margin-left:720px" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:false,text:'提交'"></a>		
		<div id="cf-Certificate-win1" style="font-size:13px" class="easyui-dialog" data-options="width:600,height:400,
			title:'清单查询-证书种类',
     		bodyCls:'certificate_query',
      		modal:true,
      		closed:true,
      		buttons:[{
	        	text:'确定',
	        	iconCls:'icon-ok',
				iconAlign:'left',
        		handler:function(row){
	          		  var vv=$('#cf-Certificate-tb1').datagrid('getSelected');
					if(vv){
						$('#cf-Certificate-zszl1').textbox('setValue',vv.zszlId);
						$('#cf-Certificate-zszl').textbox('setValue',vv.zszlName);
						$('#cf-Certificate-win1').dialog('close');
       		   		}else{
						$.messager.alert('提示','请选择一行');
					}
				}
      		},{
        	text:'取消',
        	iconCls:'icon-cancel',
	        	handler:function(){
	          		$('#cf-Certificate-win1').dialog('close');
	        	}
			}
			]">
		<div id="cf-Certificate-1">
    	 <input id="cf-Certificate-searchbox1" style="padding:20px" class="easyui-searchbox" data-options="label:'搜索',width:300,labelWidth:50">
   		 <a id="cf-Certificate-search" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true,text:'搜索'"></a>
  		</div>
		 <table id="cf-Certificate-tb1" class="easyui-datagrid" data-options="
			url:'certificate_query?zszlName=',
			fitColumns:true,
			fit:true,
			nowrap:false,
			loading:true,
			pagination:true,
			pageSize:5,
			pageList:[5,10,15,20],
			rownumbers:true,
			toolbar:'#cf-Certificate-1',
			singleSelect:true,
			method:'get'	
	">
		<thead>
			  <tr>
				<th data-options="field:'zszlId',width:60,align:'center'">种类编号</th>
				<th data-options="field:'zszlName',width:60,align:'center'">种类名称</th>
			  </tr>	
			</thead>
			<tbody>
			</tbody>
	</table>
	</div>
</body>
</html>